package kr.hkit.powerjava.chapter12.submit;

import java.util.Random;

class Rectangle1 implements Drawable {
	@Override
	public void draw() {
		System.out.println("사각형이 그려졌습니다.");
	}
}

class Circle1 implements Drawable {
	@Override
	public void draw() {
		System.out.println("원이 그려졌습니다.");
	}
}

class Triangle1 implements Drawable {
	@Override
	public void draw() {
		System.out.println("삼각형이 그려졌습니다.");
	}
}

public class DrawableTest {
	public static void main(String[] args) {
		
		Drawable[] dr = new Drawable[3];
		dr[0] = new Rectangle1();
		dr[1] = new Circle1();
		dr[2] = new Triangle1();
		
		Random rnd = new Random();
		Drawable d = dr[rnd.nextInt(3)];
		d.draw();
		Drawable d1 = dr[rnd.nextInt(3)];
		d1.draw();
	}
}
